package whf.framework.report.jasper;

import java.io.OutputStream;
import java.util.Map;

import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRHtmlExporter;
import net.sf.jasperreports.engine.export.JRHtmlExporterParameter;

/**
 * @author King
 * @create Jan 18, 2008 3:02:07 PM
 */
public class HtmlJasperReportExporter extends JasperReportExporter {

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.report.jasper.JasperReportExporter#exportReport(net.sf.jasperreports.engine.JasperPrint,
	 *      java.io.OutputStream)
	 */
	@Override
	protected void exportJasperReport(JasperPrint jasperPrint, OutputStream out) throws Exception {
		JRHtmlExporter exporter = new JRHtmlExporter();
		exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);	//使用报表(JasperPrint)
		exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);			//输出到流
		exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"image?image=");
		exporter.exportReport();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.report.ReportExporter#getContentType()
	 */
	public String getContentType() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see whf.framework.report.ReportExporter#getHeaders()
	 */
	public Map<String, String> getHeaders() {
		// TODO Auto-generated method stub
		return null;
	}

}
